home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-03-16 | 901 b | 42 lines | [TEXT/ttxt] |
- // This script adds an object with 2 triangles to the active document
- // (c) Christian Losch 1997
- // Maxon Computer GmbH
-
- Function(doc)
- {
- var m = new(Matrix);
-
- // Make object with 5 points 6 edges and 2 triangles 0 quadrangles
- var op = doc->NewPolygonObject("Propeller",NULL,NULL,5,6,2,0);
-
- op->SetPoint(0,vector(-100,-100,0));
- op->SetPoint(1,vector(-100, 100,0));
- op->SetPoint(2,vector( 0, 0,0));
- op->SetPoint(3,vector( 100, 100,0));
- op->SetPoint(4,vector( 100,-100,0));
-
- op->SetEdge(0,0,1);
- op->SetEdge(1,1,2);
- op->SetEdge(2,2,3);
- op->SetEdge(3,3,4);
- op->SetEdge(4,4,2);
- op->SetEdge(5,2,0);
-
- op->SetTriangle(0,0,1,2);
- op->SetTriangle(1,2,3,4);
-
- // Object Update
- op->UpdateObject();
-
- // Activate object
- doc->ActivateObject(op);
-
- // Refresh
- doc->SendMessage(DOCUMENT_CHANGED);
-
- }
-
- main()
- {
- RegisterMenuHook("Propeller","Function");
- }